package com.qf.ability.notify.listener;

import com.ken.event.action.apply.consumer.IKenEventHandler;
import com.ken.event.action.apply.consumer.KenEvent;
import com.ken.event.standard.entity.KenMessage;
import com.qf.ability.notify.service.IEmailNotifyService;
import com.qf.data.notify.entity.Email;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 监听邮箱验证码发送事件
 * author Ken
 * create_time 2022/11/24
 */
@KenEvent("email-code")
public class EmailCodeListener implements IKenEventHandler<Email> {

    @Autowired
    private IEmailNotifyService emailNotifyService;

    @Override
    public void eventHandler(Email data, KenMessage kenMessage) {
        emailNotifyService.sendEmail(data);
    }
}
